﻿@model PagedList.IPagedList<HdipCricketClub.Models.Member>

@{
    ViewBag.Title = "SeasonMatches";
}

<h2>Season matches<br />
    Select player:
    </h2>

@using (Html.BeginForm())
{
    <p>
        Find by Last Name: @Html.TextBox("SearchString")
        <input type="submit" value="Search" />
    </p>
}
<table>
    <tr>
        <th>
            Name:
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.first_name) @Html.DisplayFor(modelItem => item.last_name)
        </td>
        <td>
            @Html.ActionLink("Select", "GetFixtures", new { id = item.member_id })
        </td>
    </tr>
}
</table>
<br />
<div>
    Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
    of @Model.PageCount

    @if (Model.HasPreviousPage)
    {
        @Html.ActionLink("<<", "SeasonMatches", new { page = 1 })
        @Html.Raw(" ");
        @Html.ActionLink("< Prev", "SeasonMatches", new { page = Model.PageNumber - 1 })
    }
    else
    {
        @:<<
        @Html.Raw(" ");
        @:< Prev              
    }

    @if (Model.HasNextPage)
    {
        @Html.ActionLink("Next >", "SeasonMatches", new { page = Model.PageNumber + 1 })
        @Html.Raw(" ");
        @Html.ActionLink(">>", "SeasonMatches", new { page = Model.PageCount })
    }
    else
    {
        @:Next >
        @Html.Raw(" ");
        @:>>              
    }
</div>